using UnityEngine;
using QFramework;

namespace ProjectSurviver
{
	public partial class Coin : PowerUp
	{
		public override Collider2D Collider2D => SelfCollider2D;

        protected override void Execute()
        {
            AudioKit.PlaySound("Coin");
			Global.Coin.Value++;
			this.DestroyGameObjGracefully();
        }

        void OnTriggerEnter2D(Collider2D other)
        {
            if(other.GetComponent<CollectableArea>())
			{
				FlyingToPlayer = true;
			}
        }
    }
}
